//
//  TouchView.m
//  UI22_复习BLOCK
//
//  Created by 李劲成 on 16/4/8.
//  Copyright © 2016年 ljc. All rights reserved.
//

#import "TouchView.h"

@interface TouchView ()

@property (nonatomic, copy) void (^handleClick)(TouchView *);

@end

@implementation TouchView

#pragma maark - override touch
- (void)touchesEnded:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event {
    [super touchesEnded:touches withEvent:event];
    // 调用 Block
    self.handleClick(self);
    
}


#pragma mark - Creating and Init
- (instancetype)initWithFrame:(CGRect)frame ClickHandle:(void (^)(TouchView *view))handle{
    
    self = [super initWithFrame:frame];
    if (self) {
        
        self.handleClick = handle;
    }
    return self;
    
}




@end
